package com.xiaoyu.string;

/**
 * Created by xiaoyu on 16/3/30.


    声明变量的方式相加

 0: ldc           #2                  // String abc
 2: astore_1
 3: ldc           #3                  // String def
 5: astore_2
 6: new           #4                  // class java/lang/StringBuilder
 9: dup
 10: invokespecial #5                  // Method java/lang/StringBuilder."<init>":()V
 13: aload_1
 14: invokevirtual #6                  // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
 17: aload_2
 18: invokevirtual #6                  // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
 21: invokevirtual #7                  // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
 24: astore_3
 25: return

 */
public class StringOptTest2 {
    public static void main(String[] args) {
        String str1 = "abc";
        String str2 = "def";
        String str3 = str1+str2;
//        String str3 = new StringBuilder(str1).append(str2).toString();

        //for test

    }

}
